﻿// JL -
// For the databinding twoway to happen, model must have implemented InotifyPropertyChanged
// Anyway the main idea is that we already have the Model implemented on the domain context provided by RIA Services.
using System.ComponentModel;

namespace SomethingSpacial.Model
{
    public class SponsorModel : INotifyPropertyChanged
    {
        private int _SponsorID = 0;
        private string _LogoImage = "../../Images/SponsorsLogo.png";
        private string _SponsorName = "Microsoft.com";
        private string _SponsorDescription = "Microsoft.com Rocks!";
        private string _SponsorURL = "http://www.Microsoft.com";
        private bool _IsActive = true;

        public int SponsorID
        {
            get
            {
                return _SponsorID;
            }
            set
            {
                _SponsorID = value;
                NotifyPropertyChanged("SponsorID");
            }
        }

        public string LogoImage
        {
            get
            {
                return _LogoImage;
            }
            set
            {
                _LogoImage = value;
                NotifyPropertyChanged("LogoImage");
            }
        }

        public string SponsorName
        {
            get
            {
                return _SponsorName;
            }
            set
            {
                _SponsorName = value;
                NotifyPropertyChanged("SponsorName");
            }
        }

        public string SponsorDescription
        {
            get
            {
                return _SponsorDescription;
            }
            set
            {
                _SponsorDescription = value;
                NotifyPropertyChanged("SponsorDescription");
            }
        }

        public string SponsorURL
        {
            get
            {
                return _SponsorURL;
            }
            set
            {
                _SponsorURL = value;
                NotifyPropertyChanged("SponsorURL");
            }
        }

        public bool IsActive
        {
            get
            {
                return _IsActive;
            }
            set
            {
                _IsActive = value;
                NotifyPropertyChanged("IsActive");

            }
        }




        #region INotifyPropertyChanged Members
        public event PropertyChangedEventHandler PropertyChanged;
        public void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }



        #endregion
    }
}
